<template>
	<view class="list">
		<view class="content" v-for="(item,index) in list" @click="gogoods(item)">
			<image :src="item.cover" mode=""></image>
			<view class="">
				<view class="title">
					{{item.name}}
				</view>
				<view style="padding: 10rpx 0; display: flex;justify-content: space-between; margin-top: 20rpx;">
					<view class="rate">
						<u-rate count="5" size="14" v-model="rate"></u-rate>
						<text>5</text>
					</view>
					<view class="mu">
						<view class="">
							<image src="/static/mu.png" mode=""></image>
						</view>
						<view class="text">
							{{item.showNum}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "goodslist",
		data() {
			return {
				rate: 5
			};
		},
		created() {
			setTimeout(() => {
				console.log(this.list)
			}, 1000)
		},
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
		},
		methods: {
			gogoods(item) {
				console.log(item)
				uni.navigateTo({
					url: "/pages/goods/details/index?id=" + item.id
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background-color: #f7f7f7;
	}

	.list {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		padding: 0 20rpx;

		.content {
			border-radius: 10rpx;
			overflow: hidden;
			margin-top: 20rpx;
			background-color: #ffffff;

			.title {
				padding: 10rpx;
				font-weight: 600;
			}

			.rate {
				display: flex;

				text {
					margin-left: 10rpx;
					color: red;
				}
			}

			.mu {
				display: flex;
				align-items: center;

				image {
					width: 32rpx;
					height: 25rpx;
					margin-right: 2rpx;
				}

				.text {
					margin-right: 10rpx;
					font-size: 26rpx;
					color: #999;
				}
			}
		}

		image {
			width: 350rpx;
			height: 350rpx;

		}
	}
</style>
